<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml"
      xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>办理入职</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link rel="stylesheet" href="/dist/plugins/select2/select2.min.css">
    <link href="/dist/plugins/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/dist/plugins/webuploader-0.1.5/webuploader.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=84a6c1b54">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">

    <style type="text/css">
        td div {
            float: left;
            text-align: center;
            height: 100%;
        }

        td span {
            color: #2a8cec;
            padding: 0 6px;
        }

        td input {
            color: #2a8cec;
        }

        .table-detail .entryTitle {
            background-color: #f5f5f5;
        }

        .fj {
            color: #74adf2;
            cursor: pointer;
        }

        .fj-tanzhongStyle {
            margin-bottom: 1px;
            margin-top: 1px;
        }

        /*.webuploader-pick {*/
        /*position: relative;*/
        /*display: inline-block;*/
        /*cursor: pointer;*/
        /*background: none;*/
        /*padding: 0;*/
        /*color: #74adf2;*/
        /*width: 100%;*/
        /*text-align: center;*/
        /*}*/

        .biTian {
            position: absolute;
            left: 1px;
            top: 3px;
            color: red;
        }

        .rightBorder {
            border-left: 1px solid #e8e8e9;
        }

        .table-detail {
            margin: 0 auto;
        }

        .lookStyle {
            width: 100%;
            min-width: 1050px;
        }

        .lookStyle td {
            text-align: left;
            padding: 0 6px !important;
        }

        .lookStyle td.entryTitle, .lookStyle td.td-title {
            text-align: center;
        }

        .lookStyle td div {
            text-align: left;
        }

        .lookStyle .fj {
            cursor: not-allowed;
        }

        .entryTitle {
            width: 85px;
        }

        td .lookFj {
            /*width: 100%;*/
            color: #2a8cec;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            position: relative;
            cursor: pointer;
            background: none;
            padding-left: 6px;
            text-align: left;
            height: 100%;
            width: 200px;
        }

        .delfile {
            position: absolute;
            right: 0;
            top: 0;
            width: 15px;
            height: 100%;
            line-height: 24px;
            text-align: center;
            font-size: 14px;
            border-radius: 50%;
            background: #fff;
            z-index: 1111111;
            color: #bbb;
            cursor: pointer;
        }

        .delfile:hover {
            color: red;
        }

        /*季白增*/
        /*.fujian {*/
        /*display: inline-block;*/
        /*cursor: pointer;*/
        /*padding-left: 20px;*/
        /*background: url(/dist/img/fujianShu.png) no-repeat 6px center;*/
        /*color: #2a8cec;*/
        /*}*/

        .noFujian {
            /*background: url(/dist/img/fujian2.png) no-repeat 20px center;*/
            /*color: #ddd;*/
            cursor: no-drop;
            display: none;
        }

        .table-detail select {
            text-indent: 0px !important;
        }

        /*娴sir增*/
        .content {
            padding: 2px 8px;
        }

        .jiaobiao3 {
            position: relative;
        }

        .jiaobiao3 i {
            display: block;
            width: 6px;
            height: 6px;
            background: url("/dist/img/newLog3.png");
            position: absolute;
            top: 0px;
            right: 0px;
        }

        .webuploader-pick {
            background: url(/dist/img/fjT1.png) no-repeat 5px center;
            display: block;
            padding: 0 4px;
            height: 22px;
            line-height: 22px;
            padding-left: 15px;
            margin: 0 auto;
            width: 70px;
            margin-top: 6px;
            border-radius: 4px;
        }

        .webuploader-pick-hover {
            color: #fff !important;
            background: url(/dist/img/fjT2.png) no-repeat 5px center;
            background-color: #0F6099;

        }

        #divUploadedFiles {
            /*padding: 4px;*/
            padding-bottom: 0;
        }

        .webuploader-pick {
            margin-top: 3px;
        }

        .td-module {
            background: yellow !important;
            color: black;
        }

        .txt-impt {
            color: #000;
            font-size: 14px;
            position: absolute;
            top: 3px;
            left: 50%;
            margin-left: -54px;
        }

    </style>
</head>
<body>
<div class="oaLoad">
    <div class="loadGif" id="areaProgress"></div>
</div>
<iframe id="ifAttach" style="display:none"></iframe>
<ul class="ztree" id="ulZTree"
    style="z-index:999;display:none;position:absolute;background-color:white;border:1px solid #72C3D9;height:200px;margin-top:0px;margin-left:0px;padding-left:0px;padding-top:5px;padding-bottom:5px;padding-right:0px;margin-right:0px;margin-bottom:0px;overflow: auto;"></ul>
<section class="content" id="app" @click="hideZTree">
    <table class="table-detail">
        <tr>
            <td class="td-module" colspan="5">个人基本信息</td>
        </tr>
        <tr>
            <td class="entryTitle jiaobiao3" style="width: 8%">
                <i v-if="!user.name "></i><span class="txt-impt" v-if="pageType!='look'">*</span>姓名
            </td>
            <td style="width: 44%">
                <div style="width:80px;text-align: left" class="div-tanZongStyle">
                    <input v-if="pageType=='edit'" type="text" class="validators" attr-data="name"
                           v-model="user.name"/>
                    <span v-else style="cursor: not-allowed;">{{user.name}}</span></div>
                <div class="fj-tanzhongStyle " v-if="user.nameAttachName"
                     style="float: none;margin-left: 80px;    width: auto;">
                    <b :class="fjStyle(user.nameAttachName)"></b>
                    <div class="name" v-if="user.nameAttachName" :title="user.nameAttachName">
                        {{user.nameAttachName}}
                    </div>
                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                         v-on:click="download(user.nameAttachUrl,user.nameAttachName)">下载</a></div>
                    <!--<div class="del" v-if="(pageType=='edit'&&hasUpdate())||(pageType=='edit'&&!id)||(pageType=='edit'&&id&&user.nameAttachName=='')">-->
                    <div class="del" v-if="pageType=='edit'">
                        <a href="javascript:void(0)" class="nui-txt-link" v-on:click="deleteFile('nameAttach')">删除</a>
                    </div>
                </div>
                <div v-if="pageType=='look'&&user.nameAttachName==''"><span>无应聘登记表</span></div>
                <div :class="pageType=='look'?'rightBorder fujian fj noFujian validators':'rightBorder fujian fj validators'"
                     attr-data="nameAttachName"
                     id="nameAttach">上传应聘登记表
                </div>
            </td>
            <td class="entryTitle jiaobiao3" style="width: 8%;">
                <i v-if="!user.sex&&user.sex!='0'"></i><span class="txt-impt" v-if="pageType!='look'">*</span>性别
            </td>
            <td style="width: 30%;text-align: left" class="td-tanZongStyle">
                <select v-if="pageType=='edit'"
                        type="text" v-model="user.sex" class="td-value validators" attr-data="sex">
                    <option value=0>男</option>
                    <option value=1>女</option>
                </select>
                <span v-else style="cursor: not-allowed;">{{user.sex=="0"?"男":"女"}}</span>
            </td>
            <td style="width:14%" rowspan="5"><img v-if="user.imagerUrl" :src="user.imagerUrl" 性别
                                                   style="max-width:100%; height: 150px;"><span v-else>暂无照片</span></td>
        </tr>
        <tr>
            <td class="entryTitle jiaobiao3"><i v-if="!user.birthday "></i><span class="txt-impt"
                                                                                 v-if="pageType!='look'">*</span>出生日期
            </td>
            <td style="text-align: left" class="td-tanZongStyle">
                <input v-if="pageType=='edit'" type="text" v-model="user.birthday"
                       @focus="showBirthdayPicker($event,user.birthday)" class="validators" attr-data="birthday"
                       placeholder=格式为：YYYY-MM-DD，例如：1993-05-18>
                <span v-else style="cursor: not-allowed;">{{user.birthday}}</span></td>
            <td class="entryTitle jiaobiao3"><i v-if="!user.ageNumber"></i>
                <span class="txt-impt" v-if="pageType!='look'">*</span>年龄
            </td>
            <td style="text-align: left" class="td-tanZongStyle">
                <input v-if="(pageType=='edit'&&hasUpdate())||(pageType=='edit'&&!id)||(pageType=='edit'&&id&&user.ageNumber=='')"
                       type="text"
                       v-model="user.ageNumber" class="validators" attr-data="ageNumber"/>
                <span v-else style="cursor: not-allowed;">{{user.ageNumber}}岁</span></td>
            <!--<td class="entryTitle" :style="pageType=='look'?'width:130px':'width:80px'">入职时间</td>-->
            <!--<td :style="pageType=='look'?'width:504px':'width:220px'"><input v-if="pageType=='edit'" type="text"-->
            <!--v-model="user.entryDate"-->
            <!--@focus="showDatePicker($event)"-->
            <!--placeholder="请选择时间"/>-->
            <!--<span v-else>{{user.entryDate}}</span></td>-->

        </tr>
        <!--<tr>-->
        <!--<span v-else>{{Flage2Name(user.jobState)}}</span>-->
        <!--<td class="entryTitle">入职天数</td>-->
        <!--<td><input v-if="pageType=='edit'" type="text" v-model="user.dayNumber"/>-->
        <!--<span v-else>{{user.dayNumber}}天</span></td>-->
        <!--</tr>-->
        <tr>
            <!--<td class="entryTitle">联系电话</td>-->
            <!--<td><input v-if="pageType=='edit'" type="text" v-model="user.tel"/>-->
            <!--<span v-else>{{user.tel}}</span></td>-->
            <td class="entryTitle jiaobiao3"><i v-if="!user.nativePlace"></i><span class="txt-impt"
                                                                                   v-if="pageType!='look'">*</span>籍贯
            </td>
            <td style="text-align: left" class="td-tanZongStyle">
                <input v-if="pageType=='edit'" type="text"
                       v-model="user.nativePlace" class="validators" attr-data="nativePlace"/>
                <span v-else style="cursor: not-allowed;">{{user.nativePlace}}</span></td>
            <td class="entryTitle jiaobiao3"><i v-if="!user.permanent"></i><span class="txt-impt"
                                                                                 v-if="pageType!='look'">*</span>户口所在地
            </td>
            <td style="text-align: left" class="td-tanZongStyle">
                <input v-if="pageType=='edit'" type="text"
                       v-model="user.permanent" class="validators" attr-data="permanent"/>
                <span v-else style="cursor: not-allowed;">{{user.permanent}}</span></td>
        </tr>


        <tr>

            <td class="entryTitle jiaobiao3"><i v-if="!user.card"></i><span class="txt-impt"
                                                                            v-if="pageType!='look'">*</span>身份证号
            </td>
            <td style="text-align: left" class="td-tanZongStyle">
                <input v-if="pageType=='edit'" type="text"
                       v-model="user.card" class="validators" attr-data="card"/>
                <span v-else-if="roleName=='集团销售管理'||roleName=='集团人事经理'||roleName=='人事经理'||roleName=='后台管理'||roleName=='财务会计'">{{user.card}}</span>
                <span v-else style="cursor: not-allowed;">{{IdNumber(user.card)}}</span></td>

            <td class="entryTitle jiaobiao3"><i v-if="!user.cardAttachName"></i><span class="txt-impt"
                                                                                      v-if="pageType!='look'">*</span>身份证附件
            </td>
            <td>
                <div class="fj-tanzhongStyle  " v-if="user.cardAttachName">
                    <b :class="fjStyle(user.cardAttachName)"></b>
                    <div class="name" style="width:80%" v-if="user.cardAttachName" :title="user.cardAttachName">
                        {{user.cardAttachName}}
                    </div>
                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                         v-on:click="download(user.cardAttachUrl,user.cardAttachName)">下载</a></div>
                    <!-- <div class="del" v-if="(pageType=='edit'&&hasUpdate())||(pageType=='edit'&&!id)||(pageType=='edit'&&id&&user.cardAttachName=='')">-->
                    <div class="del" v-if="pageType=='edit'">
                        <a href="javascript:void(0)" class="nui-txt-link" v-on:click="deleteFile('cardAttach')">删除</a>
                    </div>
                </div>
                <div v-if="pageType=='look'&&user.cardAttachName==''"><span>无</span></div>
                <div :class="pageType=='look'?'fujian fj noFujian':'fujian fj validators'" id="cardAttach"
                     attr-data="cardAttachName">身份证附件
                </div>
            </td>
            <!--<td>-->
            <!--<div class="rightBorder fj fujian" :style="pageType=='look'?'cursor: no-drop;width:120px;':'width:120px;'" id="imager">头像上传</div>-->
            <!--<span v-if="pageType=='edit'" style="color:red;font-size:10px;">注：一寸免冠照</span>-->
            <!--</td>-->
        </tr>
        <tr>
            <td class="entryTitle jiaobiao3"><i v-if="!user.address"></i><span class="txt-impt" v-if="pageType!='look'">*</span>现居住址
            </td>
            <td style="text-align: left" class="td-tanZongStyle"><input v-if="pageType=='edit'" type="text"
                                                                        v-model="user.address"
                                                                        class="validators"
                                                                        attr-data="address"/>
                <span v-else>{{user.address}}</span></td>
            <td class="entryTitle jiaobiao3"><i v-if="!user.maritalStatus"></i><span class="txt-impt"
                                                                                     v-if="pageType!='look'">*</span>婚姻状况
            </td>
            <td style="text-align: left" class="td-tanZongStyle">
                <select v-model="user.maritalStatus" v-if="pageType=='edit'"
                        class="td-value validators" attr-data="maritalStatus">
                    <option value=-2>未婚</option>
                    <option value=-1>已婚</option>
                    <option value=0>丧偶</option>
                    <option value=1>离婚</option>
                </select>
                <span v-else>{{Flag2Marriage(user.maritalStatus)}}</span>
            </td>
        </tr>
        <tr>
            <td class="entryTitle jiaobiao3"><i v-if="!user.graduate"></i><span class="txt-impt"
                                                                                v-if="pageType!='look'">*</span>毕业院校
            </td>
            <td style="text-align: left" class="td-tanZongStyle">
                <input v-if="pageType=='edit'" type="text"
                       v-model="user.graduate" class="validators" attr-data="graduate"/>
                <span v-else style="cursor: not-allowed;">{{user.graduate}}</span>
            </td>
            <td class="entryTitle jiaobiao3"><i v-if="!user.nation"></i>
                <span class="txt-impt" v-if="pageType!='look'">*</span>民族
            </td>
            <td style="text-align: left" class="td-tanZongStyle">
                <input v-if="pageType=='edit'" type="text"
                       v-model="user.nation" class="validators" attr-data="nation"/>
                <span v-else style="cursor: not-allowed;">{{user.nation}}</span>
            </td>
            <td>
                <div :class="pageType=='look'?'fujian fj noFujian':'fujian fj'" id="imager">照片附件</div>
            </td>

        </tr>
        <tr>
            <td class="entryTitle jiaobiao3"><i v-if="!user.education"></i><span class="txt-impt"
                                                                                 v-if="pageType!='look'">*</span>学历
            </td>
            <td style="text-align: left" class="td-tanZongStyle">
                <input v-if="pageType=='edit'" type="text"
                       v-model="user.education" class="validators" attr-data="education"/>
                <span v-else style="cursor: not-allowed;">{{user.education}}</span>
            </td>
            <td class="entryTitle jiaobiao3"><i v-if="!user.professional"></i><span class="txt-impt"
                                                                                    v-if="pageType!='look'">*</span>专业
            </td>
            <td style="text-align: left" colspan="2" class="td-tanZongStyle">
                <input v-if="pageType=='edit'" type="text"
                       v-model="user.professional" class="validators" attr-data="professional"/>
                <span v-else style="cursor: not-allowed;">{{user.professional}}</span></td>
        </tr>
        <tr>
            <td class="entryTitle jiaobiao3">毕业证书</td>
            <td>
                <div class="fj-tanzhongStyle  " v-if="user.educationAttachName">
                    <b :class="fjStyle(user.educationAttachName)"></b>
                    <div class="name" style="width:80%" v-if="user.educationAttachName"
                         :title="user.educationAttachName">
                        {{user.educationAttachName}}
                    </div>
                    <div class="down"><a v-if="user.educationAttachName" href="javascript:void(0)" class="nui-txt-link"
                                         v-on:click="download(user.educationAttachUrl,user.educationAttachName)">下载</a>
                    </div>
                    <!--<div class="del"
                         v-if="(pageType=='edit'&&hasUpdate())||(pageType=='edit'&&!id)||(pageType=='edit'&&id&&user.educationAttachName=='')">-->
                    <div class="del" v-if="pageType=='edit'">
                        <a href="javascript:void(0)" class="nui-txt-link"
                           v-on:click="deleteFile('educationAttach')">删除</a>
                    </div>
                </div>
                <div v-if="pageType=='look'&&user.educationAttachName==''"><span>无</span></div>
                <div :class="pageType=='look'?'fujian fj noFujian':'fujian fj'" id="educationAttach">毕业证附件</div>
            </td>
            <td class="entryTitle">学位证书</td>
            <td colspan="2">
                <div class="fj-tanzhongStyle  " v-if="user.diplomaName">
                    <b :class="fjStyle(user.diplomaName)"></b>
                    <div class="name" style="width:80%" v-if="user.diplomaName"
                         :title="user.diplomaName">
                        {{user.diplomaName}}
                    </div>
                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                         v-on:click="download(user.diplomaUrl,user.diplomaName)">下载</a></div>
                    <!--<div class="del" v-if="(pageType=='edit'&&hasUpdate())||(pageType=='edit'&&!id)||(pageType=='edit'&&id&&user.diplomaName=='')">-->
                    <div class="del" v-if="pageType=='edit'">
                        <a href="javascript:void(0)" class="nui-txt-link" v-on:click="deleteFile('diploma')">删除</a>
                    </div>
                </div>
                <div v-if="pageType=='look'&&user.diplomaName==''"><span>无</span></div>
                <div :class="pageType=='look'?'fujian fj noFujian':'fujian fj'" id="diploma">学位证附件</div>
            </td>
        </tr>
        <tr>
            <td class="entryTitle jiaobiao3"><i v-if="!user.entrtyInforAttachName"></i><span class="txt-impt"
                                                                                             v-if="pageType!='look'">*</span>入职信息表
            </td>
            <td>
                <div class="fj-tanzhongStyle  " v-if="user.entrtyInforAttachName">
                    <b :class="fjStyle(user.entrtyInforAttachName)"></b>
                    <div class="name" style="width:80%" v-if="user.entrtyInforAttachName"
                         :title="user.entrtyInforAttachName">
                        {{user.entrtyInforAttachName}}
                    </div>
                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                         v-on:click="download(user.entrtyInforAttachUrl,user.entrtyInforAttachName)">下载</a>
                    </div>
                    <!--<div class="del"
                         v-if="(pageType=='edit'&&hasUpdate())||(pageType=='edit'&&!id)||(pageType=='edit'&&id&&user.entrtyInforAttachName=='')">-->
                    <div class="del" v-if="pageType=='edit'">
                        <a href="javascript:void(0)" class="nui-txt-link" v-on:click="deleteFile('entrtyInforAttach')">删除</a>
                    </div>
                </div>
                <div v-if="pageType=='look'&&user.entrtyInforAttachName==''"><span>无</span></div>
                <div id="entrtyInforAttach" :class="pageType=='look'?'fujian fj noFujian':'fujian fj validators' "
                     attr-data="entrtyInforAttachName">上传附件
                </div>
            </td>
            <td class="entryTitle jiaobiao3"><i v-if="!user.entrtyAgreeAttachName"></i><span class="txt-impt"
                                                                                             v-if="pageType!='look'">*</span>入职协议
            </td>
            <td colspan="2">
                <div class="fj-tanzhongStyle  " v-if="user.entrtyAgreeAttachName">
                    <b :class="fjStyle(user.entrtyAgreeAttachName)"></b>
                    <div class="name" style="width:80%" v-if="user.entrtyAgreeAttachName"
                         :title="user.entrtyAgreeAttachName">
                        {{user.entrtyAgreeAttachName}}
                    </div>
                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                         v-on:click="download(user.entrtyAgreeAttachUrl,user.entrtyAgreeAttachName)">下载</a>
                    </div>
                    <!--<div class="del"
                         v-if="(pageType=='edit'&&hasUpdate())||(pageType=='edit'&&!id)||(pageType=='edit'&&id&&user.entrtyAgreeAttachName=='')">-->
                    <div class="del" v-if="pageType=='edit'">
                        <a href="javascript:void(0)" class="nui-txt-link" v-on:click="deleteFile('entrtyAgreeAttach')">删除</a>
                    </div>
                </div>
                <div v-if="pageType=='look'&&user.entrtyAgreeAttachName==''"><span>无</span></div>
                <div id="entrtyAgreeAttach" :class="pageType=='look'?'fujian fj noFujian':'fujian fj validators'"
                     attr-data="entrtyAgreeAttachName">上传附件
                </div>
            </td>
        </tr>
        <tr>
            <td class="entryTitle jiaobiao3"><i v-if="!user.contractAttachName"></i><span class="txt-impt"
                                                                                          v-if="pageType!='look'">*</span>劳工合同
            </td>
            <td>
                <div class="fj-tanzhongStyle  " v-if="user.contractAttachName">
                    <b :class="fjStyle(user.contractAttachName)"></b>
                    <div class="name" style="width:80%" v-if="user.contractAttachName" :title="user.contractAttachName">
                        {{user.contractAttachName}}
                    </div>
                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                         v-on:click="download(user.contractAttachUrl,user.contractAttachName)">下载</a>
                    </div>
                    <!--<div class="del"
                         v-if="(pageType=='edit'&&hasUpdate())||(pageType=='edit'&&!id)||(pageType=='edit'&&id&&user.contractAttachName=='')">-->
                    <div class="del" v-if="pageType=='edit'">
                        <a href="javascript:void(0)" class="nui-txt-link"
                           v-on:click="deleteFile('contractAttach')">删除</a>
                    </div>
                </div>
                <div v-if="pageType=='look'&&user.contractAttachName==''"><span>无</span></div>
                <div id="contractAttach" :class="pageType=='look'?'fujian fj noFujian':'fujian fj validators'"
                     attr-data="contractAttachName">上传附件
                </div>
            </td>
            <td class="entryTitle jiaobiao3"><i v-if="!user.secrecyAttachName"></i><span class="txt-impt"
                                                                                         v-if="pageType!='look'">*</span>保密协议
            </td>
            <td colspan="2">
                <div class="fj-tanzhongStyle  " v-if="user.secrecyAttachName">
                    <b :class="fjStyle(user.secrecyAttachName)"></b>
                    <div class="name" style="width:80%" v-if="user.secrecyAttachName" :title="user.secrecyAttachName">
                        {{user.secrecyAttachName}}
                    </div>
                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                         v-on:click="download(user.secrecyAttachUrl,user.secrecyAttachName)">下载</a>
                    </div>
                    <!--<div class="del" v-if="(pageType=='edit'&&hasUpdate())||(pageType=='edit'&&!id)||(pageType=='edit'&&id&&user.secrecyAttachName=='')">-->
                    <div class="del" v-if="pageType=='edit'">
                        <a href="javascript:void(0)" class="nui-txt-link"
                           v-on:click="deleteFile('secrecyAttach')">删除</a>
                    </div>
                </div>
                <div v-if="pageType=='look'&&user.secrecyAttachName==''"><span>无</span></div>
                <div id="secrecyAttach" :class="pageType=='look'?'fujian fj noFujian':'fujian fj validators'"
                     attr-data="secrecyAttachName">上传附件
                </div>
            </td>
        </tr>
        <tr>
            <td class="td-module" colspan="5">岗位信息</td>
        </tr>
        <tr>
            <td class="entryTitle jiaobiao3"><i v-if="!user.roleName"></i><span class="txt-impt"
                                                                                v-if="pageType!='look'">*</span>公司-部门-职位
            </td>
            <td style="text-align: left" class="td-tanZongStyle"><input type="text" v-if="pageType=='edit'"
                                                                        @click.stop="showZTree(user,$event)"
                                                                        @focus.stop="showZTree(user,$event)"
                                                                        v-model="user.roleName" class="validators"
                                                                        attr-data="roleName"/>
                <span v-else>{{user.roleName}}</span></td>
            <td :colspan="pageType=='edit'?1:2"></td>
            <td v-if="pageType=='edit'" colspan="2" class="td-tanZongStyle">
                <input type="button" value="添加兼职" @click="addUserRole" class="btn oaBtn btn-sm"
                     />
            </td>
        </tr>
        <tr v-for="(item,index) in user.userRoles">
            <td class="entryTitle">兼职</td>
            <td class="td-tanZongStyle"><input v-if="pageType=='edit'" style="float:left;" type="text"
                                               @click.stop="showZTree(item,$event)" v-model="item.roleName"/>
                <span v-else>{{item.roleName}}</span></td>
            </td>
            <td :colspan="pageType=='edit'?1:2"></td>
            <td v-if="pageType=='edit'" colspan="2" class="td-tanZongStyle">
                <input type="button" value="移除" @click="removeUserRole(index)" class="btn oaBtn btn-xs"
                       style="width:60px;"/>
            </td>
        </tr>
        <tr>
            <td class="entryTitle jiaobiao3"><i v-if="!user.parentName"></i><span class="txt-impt"
                                                                                  v-if="pageType!='look'">*</span>直接上级
            </td>
            <td style="text-align: left" class="td-tanZongStyle"><input v-if="pageType=='edit'" type="text" autocomplete='off'
                                                                        :value="user.parentName"
                                                                        id="txtParent" @blur="testParent"
                                                                        class="validators" attr-data="parentName"/>
                <span v-else>{{user.parentName}}</span></td>
            <td class="entryTitle jiaobiao3">档案号</td>
            <td style="text-align: left" colspan="2">
                <span>{{user.fileNo?user.fileNo:"系统自动生成"}}</span></td>

        </tr>
        <tr>
            <td class="entryTitle jiaobiao3"><i v-if="!user.entryDate"></i><span class="txt-impt"
                                                                                 v-if="pageType!='look'">*</span>入职时间
            </td>
            <td style="text-align: left" class="td-tanZongStyle"><input v-if="pageType=='edit'" type="text"
                                                                        v-model="user.entryDate"
                                                                        @focus="showDatePicker($event,'entryDate')"
                                                                        placeholder="请选择时间" class="validators"
                                                                        attr-data="entryDate"/>
                <span v-else>{{user.entryDate}}</span></td>
            <td class="entryTitle jiaobiao3"><i v-if="!user.dayNumber"></i><span class="txt-impt"
                                                                                 v-if="pageType!='look'">*</span>入职天数
            </td>
            <template v-if="user.jobState!='1'">
                <td style="text-align: left" colspan="2" class="td-tanZongStyle"><input v-if="pageType=='edit'"
                                                                                        type="text"
                                                                                        v-model="user.dayNumber"
                                                                                        class="validators"
                                                                                        attr-data="dayNumber"/>
                    <span v-else>{{user.dayNumber}}天</span></td>
            </template>
            <template v-else>
                <td style="text-align: left" colspan="2">
                </td>
            </template>
        </tr>
        <tr>
            <td class="entryTitle jiaobiao3"><i v-if="!user.jobState&&user.jobState!='0'"></i><span class="txt-impt"
                                                                                                    v-if="pageType!='look'">*</span>在职状态
            </td>
            <td style="text-align: left" class="td-tanZongStyle">
                <select v-model="user.jobState" v-if="pageType=='edit' && user.jobState!='1'"
                        class="td-value validators" attr-data="jobState">
                    <option value=-2>试岗</option>
                    <option value=-1>试用期</option>
                    <option value=0>转正</option>
                </select>
                <span v-else>{{Flage2Name(user.jobState)}}</span>
            <td class="entryTitle">离职日期</td>
            <td style="text-align: left" colspan="2"><span v-if="leave[0]">{{leave[0].leaveDate}}</span></td>
        </tr>
        <tr>
            <td class="entryTitle jiaobiao3"><i v-if="!user.email "></i><span class="txt-impt"
                                                                              v-if="pageType!='look'">*</span>邮箱
            </td>
            <td style="text-align: left" class="td-tanZongStyle">
                <input v-if="pageType=='edit'" type="text" v-model="user.email" class='validators' attr-data="email"/>
                <span v-else>{{user.email}}</span></td>
            <td class="entryTitle">离岗日期</td>
            <td style="text-align: left" colspan="2"><span v-if="leave[0]">{{leave[0].leavePostDate}}</span></td>
        </tr>
        <!--<tr>-->
        <!--<td class="entryTitle jiaobiao3">-->
        <!--<i v-if="!user.targetStartMonth"></i><span class="txt-impt" v-if="pageType!='look'">*</span>目标考核开始日期-->
        <!--</td>-->
        <!--<td style="text-align: left" class="td-tanZongStyle">-->
        <!--<input v-if="pageType=='edit'" type="text" v-model="user.targetStartMonth" @focus="showDatePicker($event,'targetStartMonth')"-->
        <!--placeholder="请选择时间"  class="validators" attr-data="targetStartMonth"/>-->
        <!--<span v-else>{{user.targetStartMonth}}</span>-->
        <!--</td>-->
        <!--</tr>-->
        <tr>
            <td class="td-module" colspan="5">办公用品配置</td>
        </tr>
        <tr>
            <td class="entryTitle jiaobiao3"><i v-if="!user.wegeCard "></i><span class="txt-impt"
                                                                                 v-if="pageType!='look'">*</span>工资卡号
            </td>
            <td style="text-align: left" class="td-tanZongStyle"><input id="banks" v-if="pageType=='edit'" type="text"
                                                                        v-model="user.wegeCard" class='validators'
                                                                        attr-data="wegeCard"/>
                <span v-else>{{user.wegeCard}}</span></td>
            <td class="entryTitle jiaobiao3"><i v-if="!user.bank "></i><span class="txt-impt"
                                                                             v-if="pageType!='look'">*</span>开户行
            </td>
            <td style="text-align: left" colspan="2" class="td-tanZongStyle"><input v-if="pageType=='edit'" type="text"
                                                                                    v-model="user.bank"
                                                                                    class='validators'
                                                                                    attr-data="bank"/>
                <span v-else>{{user.bank}}</span></td>
        </tr>
        <tr>
            <td class="entryTitle jiaobiao3"><i v-if="!user.tel "></i>
                <span class="txt-impt" v-if="pageType!='look'">*</span>手机号
            </td>
            <td style="text-align: left" class="td-tanZongStyle">
                <input v-if="pageType=='edit'" type="text"
                       v-model="user.tel" class='validators' attr-data="tel" placeholder="请输入手机号"
                       style="width: 50%;float: left;"/>
                <span v-else style="width: 131px;float: left;">{{user.tel}}</span>
                <input v-if="pageType=='edit'" type="text"
                       v-model="user.trumpet" placeholder="请输入小号" style="width: 50%;"/>
                <span v-else style="width: 131px;">{{user.trumpet}}</span>
            </td>
            <td class="entryTitle jiaobiao3"><i v-if="!user.telOwner"></i><span class="txt-impt"
                                                                                v-if="pageType!='look'">*</span>手机号所有权
            </td>
            <td style="text-align: left" colspan="2" class="td-tanZongStyle">
                <select v-model="user.telOwner" class="td-value validators" v-if="pageType=='edit'"
                        attr-data="telOwner">
                    <option value=0>无</option>
                    <option value=1>个人</option>
                    <option value=2>公司</option>
                </select><span v-else>{{user.telOwner?telStart2Name(user.telOwner):""}}</span>
            </td>
        </tr>
        <tr>
            <td class="entryTitle jiaobiao3"><i v-if="!user.computerStart &&user.computerStart!='0'"></i><span
                    class="txt-impt" v-if="pageType!='look'">*</span>电脑
            </td>
            <td style="text-align: left" class="td-tanZongStyle"><select v-model="user.computerStart"
                                                                         class="td-value validators"
                                                                         v-if="pageType=='edit'"
                                                                         attr-data="computerStart">
                <option value=0>无</option>
                <option value=1>有</option>
            </select><span v-else>{{user.computerStart?computerStart2Name(user.computerStart):""}}</span></td>
            <td class="entryTitle jiaobiao3"><i v-if="!user.computerOwner&&user.computerOwner!='0'"></i><span
                    class="txt-impt" v-if="pageType!='look'">*</span>电脑所有权
            </td>
            <td style="text-align: left" colspan="2" class="td-tanZongStyle">
                <select v-model="user.computerOwner" class="td-value validators" v-if="pageType=='edit'"
                        attr-data="computerOwner">
                    <option value=0>无</option>
                    <option value=1>个人</option>
                    <option value=2>公司</option>
                </select><span v-else>{{user.computerStart?computerOwner2Name(user.computerOwner):""}}</span>
            </td>
        </tr>
        <tr>
            <td class="entryTitle">加油卡号</td>
            <td style="text-align: left" class="td-tanZongStyle"><input v-if="pageType=='edit'" type="text"
                                                                        v-model="user.oilCard" attr-data="computerOwner"
                                                                        class="validators"/>
                <span v-else>{{user.oilCard}}</span></td>
            <td class="entryTitle jiaobiao3"><span class="txt-impt" v-if="pageType!='look'">*</span>配车所有权<i
                    v-if="!user.carStart&&user.carStart!='0'"></i></td>
            <td style="text-align: left" colspan="2" class="td-tanZongStyle">
                <select name="" id="" v-model="user.carStart" class="td-value validators" v-if="pageType=='edit'"
                        attr-data="carStart">
                    <option value=0>无</option>
                    <option value=1>私车</option>
                    <option value=2>公车</option>
                </select><span v-else>{{user.carStart||user.carStart=='0'?carPoverStart2Name(user.carStart):""}}</span>
            </td>
        </tr>
        <tr>
            <td class="entryTitle">配车用途</td>
            <td style="text-align: left" class="td-tanZongStyle">
                <select v-model="user.carMatch" class="td-value" v-if="pageType=='edit'">
                    <option value=0>销售用车</option>
                    <option value=1>服务用车</option>
                    <option value=2>行政用车</option>
                </select><span v-else>{{user.carMatch?carStart2Name(user.carMatch):""}}</span>
            </td>
            <td class="entryTitle">配车品牌</td>
            <td style="text-align: left" colspan="2" class="td-tanZongStyle">
                <input v-if="pageType=='edit'" type="text" v-model="user.carBrand"/>
                <span v-else>{{user.carBrand}}</span>
            </td>
        </tr>
        <tr>

            <td class="entryTitle">配车型号</td>
            <td style="text-align: left" class="td-tanZongStyle">
                <input v-if="pageType=='edit'" type="text" v-model="user.carModel"/>
                <span v-else>{{user.carModel}}</span>
            </td>
            <td class="entryTitle jiaobiao3"><i v-if="!user.carCard&&(user.carStart=='1'||user.carStart=='2')"></i><span
                    class="txt-impt" v-if="pageType!='look'&&(user.carStart=='1'||user.carStart=='2')">*</span>配车车牌号
            </td>
            <td colspan="2" style="text-align: left" class="td-tanZongStyle">
                <input v-if="pageType=='edit'" type="text" v-model="user.carCard" attr-data="carCard"
                       class="validators"/>
                <span v-else>{{user.carCard}}</span>
            </td>
        </tr>
        <tr>
            <td class="entryTitle jiaobiao3"><i
                    v-if="!user.carAttachName&&(user.carStart=='1'||user.carStart=='2')"></i><span class="txt-impt"
                                                                                                   v-if="pageType!='look'&&(user.carStart=='1'||user.carStart=='2')">*</span>用车协议
            </td>
            <td>
                <div class="fj-tanzhongStyle  " v-if="user.carAttachName">
                    <b :class="fjStyle(user.carAttachName)"></b>
                    <div class="name" style="width:80%" v-if="user.carAttachName" :title="user.carAttachName">
                        {{user.carAttachName}}
                    </div>
                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                         v-on:click="download(user.carAttachUrl,user.carAttachName)">下载</a></div>
                    <div class="del" v-if="pageType!='look'">
                        <a href="javascript:void(0)" class="nui-txt-link"
                           v-on:click="deleteFile('carAttach')">删除</a>
                    </div>
                </div>
                <div v-if="pageType=='look'&&user.carAttachName==''"><span>无</span></div>
                <div :class="pageType=='look'?'fujian fj noFujian':'fujian fj validators'" id="carAttach"
                     attr-data="carAttachName">用车附件协议
                </div>
            </td>
            <td class="entryTitle">车补金额</td>
            <td style="text-align: left" colspan="2" class="td-tanZongStyle">
                <input v-if="pageType=='edit'" type="text" v-model="user.allowCard"/>
                <span v-else>{{user.allowCard}}</span>
            </td>
        </tr>
        <tr>
            <td class="entryTitle">门禁卡</td>
            <td style="text-align: left" class="td-tanZongStyle"><input v-if="pageType=='edit'" type="text"
                                                                        v-model="user.guardCard"/>
                <span v-else>{{user.guardCard}}</span></td>
            <td class="entryTitle">POS机</td>
            <td style="text-align: left" colspan="2" class="td-tanZongStyle"><input v-if="pageType=='edit'" type="text"
                                                                                    v-model="user.pos"/>
                <span v-else>{{user.pos}}</span></td>

        </tr>
        <tr>
            <td class="entryTitle">专用工具</td>
            <td style="text-align: left" class="td-tanZongStyle">
                <select name="" v-model="user.tool" class="td-value" v-if="pageType=='edit'">
                    <option value=0>无</option>
                    <option value=1>有</option>
                </select><span v-else>{{user.tool==0?"无":user.tool==1?"有":""}}</span>
            </td>
            <td class="entryTitle">工具清单</td>
            <td colspan="2">
                <div class="fj-tanzhongStyle  " v-if="user.toolAttachName">
                    <b :class="fjStyle(user.toolAttachName)"></b>
                    <div class="name" style="width:80%" v-if="user.toolAttachName" :title="user.toolAttachName">
                        {{user.toolAttachName}}
                    </div>
                    <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                         v-on:click="download(user.toolAttachUrl,user.toolAttachName)">下载</a></div>
                    <div class="del" v-if="pageType!='look'"><a href="javascript:void(0)" class="nui-txt-link"
                                                                v-on:click="deleteFile('toolAttach')">删除</a></div>
                </div>
                <div v-if="pageType=='look'&&user.toolAttachName==''"><span>无</span></div>
                <div :class="pageType=='look'?'fujian fj noFujian':'fujian fj'" id="toolAttach">工具清单附件</div>
            </td>

        </tr>
        <tr>
            <td class="entryTitle">销售工服数量</td>
            <td style="text-align: left" class="td-tanZongStyle"><input v-if="pageType=='edit'" type="text"
                                                                        v-model="user.salesClothes"/>
                <span v-else>{{user.salesClothes}}</span></td>
            <td class="entryTitle">领用时间</td>
            <td style="text-align: left" colspan="2" class="td-tanZongStyle"><input v-if="pageType=='edit'" type="text"
                                                                                    v-model="user.salesClothesTime"/>
                <span v-else>{{user.salesClothesTime}}</span></td>
        </tr>
        <tr>
            <td class="entryTitle">服务工服数量</td>
            <td style="text-align: left" class="td-tanZongStyle"><input v-if="pageType=='edit'" type="text"
                                                                        v-model="user.servicesClothes"/>
                <span v-else>{{user.servicesClothes}}</span></td>
            <td class="entryTitle">领用时间</td>
            <td style="text-align: left" colspan="2" class="td-tanZongStyle"><input v-if="pageType=='edit'" type="text"
                                                                                    v-model="user.servicesClothesTime"/>
                <span v-else>{{user.servicesClothesTime}}</span></td>
        </tr>

        <template v-if="leave&&leave.length>0" v-for="(item,i) in leave">
            <tr>
                <td class="td-module" colspan="5">离职信息</td>
            </tr>
            <tr>
                <td class="entryTitle">离职日期</td>
                <td style="text-align: left">{{item.leaveDate}}</td>
                <td class="entryTitle">离职类型</td>
                <td style="text-align: left" colspan="2">{{item.leaveType=="0"?"辞职自动离职":"辞退"}}</td>
            </tr>
            <tr>
                <td class="entryTitle">离职原因</td>
                <td style="text-align: left" colspan="4">{{item.leaveReason}}</td>
            </tr>
            <tr>
                <td class="entryTitle">审计结果</td>
                <td style="text-align: left">
                    <div v-if="item.auditAttachName" class="lookFj"
                         @click="download(item.auditAttachName,item.auditAttachUrl)">{{item.auditAttachName}}
                    </div>
                </td>

                <td class="entryTitle">离职会签单</td>
                <td style="text-align: left" colspan="2">
                    <div v-if="item.leaveAttachName" class="lookFj"
                         @click="download(item.leaveAttachUrl,item.leaveAttachName)">{{item.leaveAttachName}}
                    </div>
                </td>

            </tr>
            <tr>
                <td class="entryTitle">离职说明</td>
                <td style="text-align: left">
                    <div v-if="item.leaveDescAttachName" class=" lookFj"
                         @click="download(item.leaveDescAttachUrl,item.leaveDescAttachName)">
                        {{item.leaveDescAttachName}}
                    </div>
                </td>
                <td class="entryTitle">解除劳动合同协议</td>
                <td style="text-align: left" colspan="2">
                    <div v-if="item.leaveContractAttachName" class=" lookFj"
                         @click="download(item.leaveContractAttachUrl,item.leaveContractAttachName)">
                        {{item.leaveContractAttachName}}
                    </div>
                </td>

            </tr>
        </template>

    </table>
    <div style="height:30px;text-align: center;z-index:999;" v-if="pageType=='edit'">
        <input type="button" value="保存" @click="save()" class="btn oaBtn btn-sm" style="margin-top:5px;">
    </div>
</section>
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=602456c3"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=ff1c9bf8"></script>
<script type="text/javascript" src="/dist/plugins/select2/select2.min.js"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<!--<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePickerYearMonth2.js"></script>-->
<!--ztree组件所需js-->
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.exhide-3.5.js"></script>
<script src="/dist/plugins/webuploader-0.1.5/webuploader.min.js"></script>
<script type="text/javascript">
    var zTreeCallback = {
        onClick: function (event, treeId, treeNode) {
            if (treeNode.type === "role") {
                roleGlobal.roleId = treeNode.dataId;
                var node = app.treeObj.getNodeByParam("id", treeNode.departId, null);
                var companyNode = app.treeObj.getNodeByParam("id", node.companyId, null);
                roleGlobal.roleName = companyNode.name + "_" + node.name + "-" + treeNode.name;
                $("#ulZTree").hide();
            }
        }
    };
    var zTreeSetting = {
        view: {
            showIcon: function (treeId, treeNode) {
                return treeNode.isParent;
            }
        },
        data: {
            simpleData: {
                enable: true
            },
            keep: {
                parent: true
            }
        },
        callback: {
            onClick: zTreeCallback.onClick
        }
    };
</script>
<script type="text/javascript">

    var roleGlobal = null;
    var app = new Vue({
            el: '#app',
            data: {
                pageType: 'edit',//如果pageType=edit说明是编辑页面，如果pagetype=look，说明是查看页面\
                editType: $.wyui.page.urlParams.editType,
                id: $.wyui.page.urlParams.id,
                roleName: getCurrentUser().roleName,
                currentUser: getCurrentUser(),
                user: {
                    id: 0,
                    fileNo: '',//档案号
                    name: '',
                    sex: '',
                    tel: '',
                    trumpet: '',
                    pwd: '111111',
                    birthday: '',
                    address: '',//现居住地
                    graduate: '',//毕业院校
                    nation: '',//民族
                    nativePlace: '',//籍贯
                    card: '',//身份证号
                    education: '',//学历
                    professional: '',//专业
                    roleId: '',//职位ID
                    roleName: '',
                    userRoles: [],
                    createUserId: getCurrentUser().id,
                    updateUserId: getCurrentUser().id,
                    entryDate: '',//入职时间
                    frontFlag: '',
//                leaveDate: '',//离职时间
                    jobState: '-2',//-2：试岗，-1：试用期，0：转正，1：离职，2：档案不全
                    maritalStatus: '',//婚姻状况
//                sortNo: '',//排序
                    parentId: '',
                    parentName: '',
                    email: '',
                    bank: '',//开户行
                    wegeCard: '',//工资卡
                    computerStart: '',//电脑
                    carCard: '',//车牌
                    carStart: '',//类型
                    carBrand: '',//类型
                    oilCard: '',//油卡
                    carModel: '',//型号
                    allowCard: '',//车补
                    guardCard: '',//门禁卡
                    tool: '',//工具
                    pos: '',//post机
                    workClothes: '',//工服
                    nameAttachName: '',
                    nameAttachUrl: '',
                    cardAttachName: '',
                    cardAttachUrl: '',
                    educationAttachName: '',
                    educationAttachUrl: '',
                    carAttachName: '',
                    carAttachUrl: '',
                    allowAttachName: '',
                    allowAttachUrl: '',
                    toolAttachName: '',
                    toolAttachUrl: '',
                    entrtyInforAttachName: '',
                    entrtyInforAttachUrl: '',
                    entrtyAgreeAttachName: '',
                    entrtyAgreeAttachUrl: '',
                    contractAttachName: '',
                    contractAttachUrl: '',
                    secrecyAttachName: '',
                    secrecyAttachUrl: '',
                    archivaType: 0,
                    imagerUrl: '',
                    permanent: "",//户籍
                    diplomaName: "",//学位证书
                    diplomaUrl: "",//学位证书
                    telOwner: "",//手机所有权
                    salesClothes: "",
                    salesClothesTime: "",
                    servicesClothes: "",
                    servicesClothesTime: "",
                    carMatch: "",
                    carOwner: "",
                    computerOwner: ""
                },
                leave: '',
                desc: '',
                treeObj: null,
                treeNodes: []
            },
            methods: {
                hasUpdate: function () {
                    //控制谁可以编辑
//                var nameList="曹国玉"
                    var nameList = ""
                    if (nameList.indexOf(currentUser.name) > -1) {
                        console.log("可以编辑")
                        return true;
                    } else {
                        console.log("不可以编辑")
                        return false;
                    }
                },
                IdNumber: function (idNum) {
                    if (idNum) {
                        var firstIdNum = idNum.substring(0, 10);
                        var lastIdNum = idNum.substring(idNum.length - 4, idNum.length);
                        return firstIdNum + "****" + lastIdNum;
                    }

                },
                Flage2Name: function (flage) {
                    if (flage == "-2") return "试岗";
                    if (flage == "-1") return "试用期";
                    if (flage == "0") return "转正";
                    if (flage == "1") return "离职";
                    if (flage == "2") return "档案不全";
                },
                Flag2Marriage: function (flage) {
                    if (flage == "-2") return "未婚";
                    if (flage == "-1") return "已婚";
                    if (flage == "0") return "丧偶";
                    if (flage == "1") return "离婚";
                },
                carPoverStart2Name: function (flage) {
                    console.log(flage)
                    if (flage == "0") return "无";
                    if (flage == "1") return "私车";
                    if (flage == "2") return "公车";
                },
                telStart2Name: function (flage) {
                    if (flage == "0") return "无";
                    if (flage == "1") return "个人";
                    if (flage == "2") return "公司";
                },
                computerStart2Name: function (flage) {
                    if (flage == "0") return "无";
                    if (flage == "1") return "有";
                },
                computerOwner2Name: function (flage) {
                    if (flage == "0") return "无";
                    if (flage == "1") return "个人";
                    if (flage == "2") return "公司";
                },
                carStart2Name: function (flage) {
                    if (flage == "0") return "销售用车";
                    if (flage == "1") return "服务用车";
                    if (flage == "2") return "行政用车";
                },
                download: function (attachId, fileName) {
                    downloadFile(attachId, fileName)
                    return false;
                },
                testParent: function () {
                    var that = this;
                    setTimeout(function () {
                        console.log(that.user.parentName, $("#txtParent").val())
                        if (that.user.parentName != $("#txtParent").val()) {
                            alert("请重新填写上级");
                            $("#txtParent").val(that.user.parentName);
                        }
                        $("#txtParent").blur();
                    }, 300)

                },
                showZTree: function (role, e) {
                    if (this.pageType == '2') return;
                    roleGlobal = role;
                    var $obj = $(e.target);
                    var offset = $obj.offset();
                    $("#ulZTree").css({
                        left: (offset.left - 1) + "px",
                        top: (offset.top + $obj.outerHeight() + 1) + "px",
                        width: ($obj.outerWidth() + 2) + "px"
                    }).slideDown("fast");
                },
                hideZTree: function () {
                    $("#ulZTree").hide();
                },
                showBirthdayPicker: function (e, strBirthday) {
                    var that = this;
                    WdatePicker({
                        onpicked: function (dp) {
                            var strBirthdayArr = strBirthday.split("-");
                            var d = new Date();
                            var yearDiff = d.getFullYear() - strBirthdayArr[0];
                            var monthDiff = d.getMonth() + 1 - strBirthdayArr[1];
                            var dayDiff = d.getDate() - strBirthdayArr[2];
                            var age = monthDiff < 0 || (monthDiff == 0 && dayDiff < 0) ? yearDiff - 1 : yearDiff; //判断有没有到生日,没到就减1
                            that.user.birthday = dp.cal.getNewDateStr();
                            that.user.ageNumber = age < 0 ? 0 : age;
                            console.log("年龄：" + age);
                            return true;
                        },
                    });
                    $(e.target).blur();
                },

                showDatePicker: function (e, type) {
                    var that = this;
                    if (type == 'entryDate') {
                        WdatePicker({
                            onpicked: function (dp) {
                                that.user.entryDate = dp.cal.getNewDateStr();
                                return true;
                            },
                        });
                        $(e.target).blur();
                    }
                    if (type == 'targetStartMonth') {
                        WdatePicker2({
                            onpicked: function (dp) {
                                that.user.targetStartMonth = dp.cal.getNewDateStr();
                                return true;
                            },
                        });
                        $(e.target).blur();
                    }
                },
                telTrim: function () {
                    this.user.tel = this.user.tel.replace(' ', '');
                },
                deleteFile: function (item) {
                    if (window.confirm("确定要删除该附件吗?")) {
                        console.log(item)
                        this.user[item + "Name"] = "";
                        this.user[item + "Url"] = "";
                        $("#" + item).show();
                    }
                },
                download: function (attachId, fileName) {
                    downloadFile(attachId, fileName)
                    return false;
                },
                fjStyle: function (fjName) {
                    if (fjName) {
                        var type = fjName.substring(fjName.lastIndexOf('.') + 1);
                        return 'img fj-' + type
                    }
                    return 'img'
                },
                save: function () {
                    var self = this;
                    var success = false;
                    if (currentUser.name == '曹国玉') {
                        if (self.user.tel == '') {
                            alert("请填写手机号");
                            success = false;
                            return false;
                        }
                        success = true;
                    } else {
                        if (self.user.tel == '') {
                            alert("请填写手机号");
                            success = false;
                            return false;
                        }
                        if (server.fwq) {
                            if (server.fwq == "wyp") {
                                success = true
                            }
                        } else {
                            $(".validators").each(function () {
                                var name = $(this).attr("attr-data")
                                if (self.user[name] || self.user[name] == '0') {
                                    $(this).css("border", "none");
                                    success = true;
                                    if (name == 'birthday' && !self.isDate(self.user.birthday)) {
                                        $(this).css("border", "1px solid red");
                                        $(this).focus()
                                        $(this).animate({marginLeft: "-10px"}, 100).animate({marginLeft: "10px"}, 100)
                                            .animate({marginLeft: "-10px"}, 100).animate({marginLeft: "10px"}, 100)
                                            .animate({marginLeft: "0px"}, 100)
                                        alert("生日格式不正确:YYYY-MM-DD");
                                        success = false;
                                        return false;
                                    }
                                    if (name == 'tel' && self.user.tel.length != 11) {
                                        $(this).css("border", "1px solid red");
                                        $(this).focus()
                                        $(this).animate({marginLeft: "-10px"}, 100).animate({marginLeft: "10px"}, 100)
                                            .animate({marginLeft: "-10px"}, 100).animate({marginLeft: "10px"}, 100)
                                            .animate({marginLeft: "0px"}, 100)
                                        alert("手机号格式不正确");
                                        success = false;
                                        return false;
                                    }
                                    if (name == 'parentName' && self.user.name == self.user.parentName) {
                                        $(this).css("border", "1px solid red");
                                        $(this).focus()
                                        $(this).animate({marginLeft: "-10px"}, 100).animate({marginLeft: "10px"}, 100)
                                            .animate({marginLeft: "-10px"}, 100).animate({marginLeft: "10px"}, 100)
                                            .animate({marginLeft: "0px"}, 100)
                                        alert("上级不能是自己，请重新填写上级！");
                                        success = false;
                                        return false;
                                    }
                                } else {
                                    if ((name == 'carCard' && (self.user.carStart == '0')) || (name == 'carAttachName' && (self.user.carStart == '0'))) {
                                    } else {
                                        if ($(this).is("input")) {
                                            $(this).css("border", "1px solid red");
                                            $(this).focus()
                                            $(this).animate({marginLeft: "-10px"}, 100).animate({marginLeft: "10px"}, 100)
                                                .animate({marginLeft: "-10px"}, 100).animate({marginLeft: "10px"}, 100)
                                                .animate({marginLeft: "0px"}, 100)
                                        } else {
                                            $(this).css("border", "1px solid red");
                                            $("html,body").animate({scrollTop: $(this).offset().top}, 1000);
                                            $(this).animate({marginLeft: "-10px"}, 100).animate({marginLeft: "10px"}, 100)
                                                .animate({marginLeft: "-10px"}, 100).animate({marginLeft: "10px"}, 100)
                                                .animate({marginLeft: "0px"}, 100)
                                        }
                                        success = false;
                                        alert("请完善员工信息！")
                                        return false;
                                    }
                                }
                            })
                        }

                        console.log(success)
                        if (self.user.jobState == "" && self.user.jobState != "0") {
                            alert("请选择在职状态");
                            return false;
                        }
                    }
                    if (success) {
                        if (self.user.id == "0") {
                            $.wyui.postMethod(urlConfig.system.user.getUserByTel, {tel: self.user.tel}, function (r) {
                                console.log(r.isTel);
                                if (r.isTel) {
                                    alert("手机号已经存在，请重新输入！")
                                } else {
                                    self.user.archivaType = "1";
                                    jQuery.each(self.user, function (i, val) {
                                        if (val == null || $.trim(val) == "" || val.length == 0) {
                                            self.user.archivaType = "0";
                                        }
                                    });
                                    $.wyui.postLoadMethod(urlConfig.system.user.saveUser, trimRN(self.user), function (r) {
                                        if (r.id == '保存失败') {
                                            alert('保存失败')
                                        } else {
                                            alert("保存成功");
                                            if (self.editType) {
                                                var $iframe = top.findIframeByName("人事管理");
                                                $iframe[0].contentWindow.app.getList();
                                                var api = frameElement.api, W = api.opener;
                                                api.close();
                                            } else {
                                                var $iframe = top.findIframeByName("组织机构");
                                                $iframe[0].contentWindow.refresh();
                                                var api = frameElement.api, W = api.opener;
                                                api.close();
                                            }
                                        }

                                    }, false, true);
                                }
                            });
                        } else {
                            jQuery.each(self.user, function (i, val) {
                                self.user.archivaType = "1";
                                jQuery.each(self.user, function (i, val) {
                                    if (val == null || $.trim(val) == "" || val.length == 0) {
                                        console.log(i + "-" + val)
                                        if (i != "fileNo") {
                                            self.user.archivaType = "0";
                                        }
                                    }
                                });
                            });
                            $.wyui.postMethod(urlConfig.system.user.saveUser, trimRN(self.user), function (r) {
                                if (r.id == '保存失败') {
                                    alert('保存失败')
                                } else {
                                    alert("保存成功");
                                    if (self.editType) {
                                        var $iframe = top.findIframeByName("人事管理");
                                        $iframe[0].contentWindow.app.getList();
                                        var api = frameElement.api, W = api.opener;
                                        api.close();
                                    } else {
                                        var $iframe = top.findIframeByName("组织机构");
                                        $iframe[0].contentWindow.refresh();
                                        var api = frameElement.api, W = api.opener;
                                        api.close();
                                    }
                                }
                            });
                            if (self.user.frontFlag == 1) {
                                $.wyui.postMethod('/bonus/updateBonusMoney.json', {
                                    userId: self.user.id,
                                    type: 0
                                }, function (data) {
                                    $.wyui.postMethod('/regionAchivementsService/transferPosCountMoney.json', {userId: self.user.id}, function (data) {
                                        //实时绩效奖惩金额
                                    });
                                },true);
                            }

                        }

                    }

                },
                //兼职添加一行
                addUserRole: function () {
                    this.user.userRoles.push({roleId: '', roleName: '', userId: 0});
                },
                //兼职删除一行
                removeUserRole: function (index) {
                    this.user.userRoles.splice(index, 1);
                },
                //描述添加一行
                addUserDesc: function () {
                    this.user.desc.push({description: '', userId: 0});
                },
                //日期格式限制
                isDate: function (val) {
                    var pattern = /^((19[2-9]\d{1})|(20((0[0-9])|(1[0-8]))))\-((0?[1-9])|(1[0-2]))\-((0?[1-9])|([1-2][0-9])|30|31)$/;
                    if (pattern.test(val)) {
                        var date = new Date(val);
                        var month = val.substring(val.indexOf("-") + 1, val.lastIndexOf("-"));
                        return date && (date.getMonth() + 1 == parseInt(month));
                    }
                    return false;
                }
            },
            mounted:
                function () {
                    var that = this
                    console.log(currentUser)
                    that.pageType = $.wyui.page.urlParams.pageType;
                    $.wyui.postMethod(urlConfig.system.system.getOrgTreeNodesByUserId, {userId: getCurrentUser().id}, function (nodes) {
                        that.treeObj = $.fn.zTree.init($("#ulZTree"), zTreeSetting, nodes);
                    });
                    if ($.wyui.page.urlParams.id) {
                        $.wyui.postMethod(urlConfig.system.user.getById, {userId: $.wyui.page.urlParams.id}, function (user) {
                            $.wyui.postMethod(urlConfig.system.user2Role.getRolesByUserId, {userId: $.wyui.page.urlParams.id}, function (userRoles) {
                                user.userRoles = [];
                                if (user.userRoles) {
                                    for (var i = 0; i < userRoles.length; i++) {
                                        user.userRoles.push({
                                            roleId: userRoles[i].id,
                                            roleName: userRoles[i].companyName + "_" + userRoles[i].departName + "_" + userRoles[i].roleName,
                                            userId: 0
                                        });

                                    }
                                }
                                that.user = user;
                                $(".fj").each(function () {
                                    var demo = $(this);
                                    var name = demo.attr("id");
                                    var nameValue = name + "Name";
                                    console.log(that.user[nameValue]);
                                    if (that.user[nameValue]) {
                                        $("#" + name).hide();
                                    }
                                });
                            });

                        });
                        $.wyui.postMethod(urlConfig.system.user.getLeaveByUserId, {userId: $.wyui.page.urlParams.id}, function (user) {
                            console.log("leave");
                            that.leave = user;
                            console.log(user)
                        });
                        $.wyui.postMethod(urlConfig.system.user.getUserDescByUserId, {userId: $.wyui.page.urlParams.id}, function (user) {
                            console.log("desc");
                            that.desc = user;
                            console.log(user)
                        });

                    } else {
                        $(".fj").each(function () {
                            var demo = $(this);
                            var name = demo.attr("id");
                            var nameValue = name + "Name";
                            console.log(that.user[nameValue])
                            if (that.user[nameValue]) {
                                $("#" + name).hide();
                            }
                        });

                    }

                    if (that.pageType != "look") {
                        //初始化上传控件
                        $(".fj").each(function () {
                            var demo = $(this);
                            var name = demo.attr("id");
                            var nameValue = name + "Name";
                            console.log(that.user)


                            var uploader = WebUploader.create({
                                // 选完文件后，是否自动上传。
                                auto: true,
                                // swf文件路径
                                swf: "/statics/plugin/webuploader-0.1.5/Uploader.swf",
                                // 文件接收服务端。
                                server: server.fjIp + "/attach/uploadFile.json",
                                // 选择文件的按钮。可选。
                                // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                                pick: '#' + demo.attr("id"),
                                duplicate: true
                            });
                            // 文件上传过程中创建进度条实时显示。
                            uploader.on('uploadProgress', function (file, percentage) {
                                console.log(percentage)
                                var $li = $('#' + file.id),
                                    $percent = $li.find('.progress span');
                                // 避免重复创建
                                if (!$percent.length) {
                                    $percent = $('<p class="progress"><span></span></p>')
                                        .appendTo($li)
                                        .find('span');
                                }
                                $percent.css('width', percentage * 100 + '%');
                            });
                            uploader.on("uploadStart", function () {
                                $("#progress").show();
                            });
                            uploader.on("uploadComplete", function () {
                                $("#progress").hide();
                            });
                            // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                            uploader.on('uploadSuccess', function (file, response) {
                                console.log(demo);
                                var nameValue = name + "Name";
                                var urlValue = name + "Url";
                                app.user[nameValue] = response.name;
                                app.user[urlValue] = response.url;
                                console.log(app.user)
                                $("#" + name).hide();
                            });

                            // 文件上传失败，显示上传出错。
                            uploader.on('uploadError', function (file) {
                                alert("上传失败！");
                            });

                        });
                    }
                }
        })
    ;
    $(function () {
        $("#txtParent").autoComplete({
            url: server.ip + urlConfig.system.user.getTop10ByNameUser,
            render: function (users, panel) {
                for (var i = 0; i < users.length; i++) {
                    $("<li></li>").data("autoComplete",
                        users[i]).html("<a>" + users[i].name + "&nbsp;&nbsp;&nbsp;" +
                        "(" + "&nbsp;" + users[i].companyName + "-" + users[i].departName + "-" + users[i].roleName + "&nbsp;" + ") " + "</a>")
                        .appendTo(panel);
                }
            },
            selected: function (user) {
                console.log(user);
                app.user.parentId = user.id;
                app.user.parentName = user.name;
                return false;
            },
            height: 210,
            width: 300
        });
    });
    $(function () {
        $('#banks').keyup(function () {
            var value = $(this).val().replace(/\s/g, '').replace(/(\d{4})(?=\d)/g, "$1 ");
            $(this).val(value)
        })
    })
</script>
</body>
</html>